<template>
    <div class="demo3">
        <!-- 头部 -->
        <!-- <div class="header">
            <x-icon type="ios-arrow-left" size="" class="icon-white" @click="$router.go(-1)"></x-icon>选择检查单位
        </div> -->
        <!-- 内容部分 -->
        <div class="demo3_main">
            <noData v-if="arr1 == 0"></noData>
            <div class="list1Box">
                <group>
                    <radio :options="arr1" @on-change="change" v-model="radios"></radio>
                </group>
            </div>
        </div>
        <!-- <myMenu @clickBack="back"></myMenu> -->
    </div>
</template>
<script>
import {Radio, Group} from 'vux'
import myMenu from '@/commonComponents/menu'
export default {
    components: {
        Radio,
        Group,
        myMenu
    },
  data () {
      return {
          show: false,
          radios: '',
          parmas: {
              allowPaging: 'true',
              business: 'getDivderPeopleList',
              data: {
                  departId: ''
              },
              pageIndex: 0,
              pageSize: 20000,
              tokenId: 'A3944C2D655B11D684296E71CB81C9BD',
              userId: ''
          },
          arr1: [],
          arr2: []
      }
  },
  mounted () {
      var token = JSON.parse(window.localStorage.getItem('userInfo'))
      this.parmas.userId = token.userid
      this.parmas.data.departId = token.deptid
      this.radios = this.$route.query.radios
      this.dataArr()
  },
  methods: {
      back () {

      },
    change (value, label) {
      for (var k of this.arr2) {
          if (k.realName == value && this.$route.query.type == 1) {
              window.sessionStorage.setItem('name3', k.realName)
              window.sessionStorage.setItem('id3', k.memberId)
              this.$router.go(-1)
          }
          if (k.realName == value && this.$route.query.type == 2) {
              window.sessionStorage.setItem('name4', k.realName)
              window.sessionStorage.setItem('id4', k.memberId)
              this.$router.go(-1)
          }
      }
    },
    dataArr () {
      this.$axiosAjax.getConfigJson(this.parmas).then((res) => {
            if (res.status) {
                for (var k of res.data.data) {
                    this.arr1.push(k.realName)
                }
                this.arr2 = res.data.data
            }
         }
      )
    }
  }
}
function getResult (val) {
  let rs = []
  for (let i = 0; i < 20; i++) {
    rs.push({
      title: `${val} result: ${i + 1} `,
      other: i
    })
  }
  return rs
}
</script>
<style lang="less" scope>
.demo3{
    width: 100%;
    height: 100%;
    .header{
        width: 100%;
        height: 40px;
        line-height: 40px;
        text-align: center;
        position: relative;
        font-size: 18px;
        background: #2269ff;
        color: #fff;
        .vux-x-icon{
            fill:cornsilk;
            position: absolute;
            left: 0;
            top: 5px;
            width: 30px;
            height: 30px;
        }
    }
    .demo3_main{
        height: 603px;
        width: 100%;
        background-color: #ebeef2;
        .list1Box{
            width: 100%;
            height: 603px;
            background-color: #fff;
            .weui-search-bar__cancel-btn{
                display: none;
            }
        }
    }
    .weui-cells_radio{
        // margin-top: 40px;
    }
    .vux-search-fixed{
        top: 40px;
    }
    .weui-cells.vux-search_show{
        display: none;
    }
    .vux-search-box{
                position: static!important;
    }
}
</style>
